package com.health.controller;


import com.health.dto.DepartmentPageQueryDTO;
import com.health.result.PageResult;
import com.health.result.Result;
import com.health.service.DepartmentService;
import com.health.vo.DepartmentDateVO;
import com.health.vo.DepartmentVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 说明：
 *
 * @author XUYINGLIU 2023年03月12日19:41
 * @version 1.0
 */
@Slf4j
@RestController
@RequestMapping("/department")
public class DepartmentController {

    @Autowired
    private DepartmentService departmentService;

    /**
     * 科室列表
     */
    @GetMapping("list")
    public Result page(DepartmentPageQueryDTO departmentPageQueryDTO) {
        log.info("科室列表查询:{}", departmentPageQueryDTO);
        List<DepartmentVO>  pageResult = departmentService.pageQuery(departmentPageQueryDTO);
        return Result.success(pageResult);
    }

    /**
     * 科室列表日期
     */
    @GetMapping("/date/list")
    public Result<List<DepartmentDateVO>> getDate() {
        List<DepartmentDateVO> vo = departmentService.getDate();
        return Result.success(vo);
    }
}
